﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;

namespace ADOcaiwenlong
{
    class Program
    {
        static void Main(string[] args)
        {
            string abcc = "server=.;datebase=sdas;uid=sa;pwd=123456";
            SqlConnection abcd = new SqlConnection(abcc);
            abcd.Open();
            var abcde = "select*from User";
            SqlCommand sqlCommand = new SqlCommand(abcc,abcd);
            var cnn = sqlCommand.ExecuteReader();
            Console.WriteLine("{0}\t{1}\t{2}","ID","名字","性别");
            while (cnn.Read())
            {
                Console.WriteLine("{0}\t{1}\t{2}","cnn[id],cnn[name],cnn[sex]");

            }
            abcd.Close();

        }
    }
}
